package com.xq.dao.impl;

import com.xq.dao.PeopleDao;
import com.xq.pojo.People;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * @author xq
 * @version 1.0
 * @date 2021/4/6 8:42
 * @description 人们数据接口实现层
 */
// 代表是一个数据库层对象
@Repository
public class PeopleDaoImpl implements PeopleDao {

    /**
     * 数据源注入
     */
    @Autowired
    private String dataSource;

    @Override
    public People getUserById(Integer id) {
        People p = null;
        switch (id) {
            case 1:
                p = new People(1,"小哈","东莞");
                break;
            case 2:
                p = new People(2,"小慧","深圳");
                break;
            case 3:
                p = new People(3,"小智","广州");
                break;
        }
        return p;
    }
}
